from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from config import config
from selenium.webdriver.support.wait import WebDriverWait
from common.base_page import BasePage
class UserSettingPage(BasePage):
    '''
    1. 获取用户账户信息：定位
    '''
    url = config.HOST + "/main/UserSetting"
    user_account_locator = (By.XPATH, '//h6[@class="name"]')

    def get_user_account(self):
        """获取用户的账号信息"""
        e = WebDriverWait(self.driver, 10).until(
            EC.visibility_of_element_located(self.user_account_locator)
        )
        return e.text.strip()